
DEBUG?=n
TARGET=mkromfs

CC=gcc
RM=rm -f

CFLAGS += -Wall -Wno-format-truncation -Werror

SRC=$(wildcard *.c)
OBJS=$(patsubst %.c, %.o, $(SRC))

ifeq ($(DEBUG), y)
CFLAGS += -O0 -g -DDEBUG -DLINENO
else
CFLAGS += -O2
endif


.PHONY: clean

all: $(OBJS)
	$(CC) -o $(TARGET) $^

%.o: %.c
	$(CC) $(CFLAGS) -c $^

clean:
	$(RM) $(target) $(OBJS)

